\(\int \frac {A+B \sin (e+f x)}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx\) [178]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 40, antiderivative size = 103 \[ \int \frac {A+B \sin (e+f x)}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx=\frac {(A+B) \cos (e+f x)}{2 f \sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}}+\frac {(A-B) \text {arctanh}(\sin (e+f x)) \cos (e+f x)}{2 c f \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \]

[Out]

1/2*(A+B)*cos(f*x+e)/f/(c-c*sin(f*x+e))^(3/2)/(a+a*sin(f*x+e))^(1/2)+1/2*(A-B)*arctanh(sin(f*x+e))*cos(f*x+e)/
c/f/(a+a*sin(f*x+e))^(1/2)/(c-c*sin(f*x+e))^(1/2)

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.075, Rules used = {3051, 2820, 3855} \[ \int \frac {A+B \sin (e+f x)}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx=\frac {(A-B) \cos (e+f x) \text {arctanh}(\sin (e+f x))}{2 c f \sqrt {a \sin (e+f x)+a} \sqrt {c-c \sin (e+f x)}}+\frac {(A+B) \cos (e+f x)}{2 f \sqrt {a \sin (e+f x)+a} (c-c \sin (e+f x))^{3/2}} \]

[In]

Int[(A + B*Sin[e + f*x])/(Sqrt[a + a*Sin[e + f*x]]*(c - c*Sin[e + f*x])^(3/2)),x]

[Out]

((A + B)*Cos[e + f*x])/(2*f*Sqrt[a + a*Sin[e + f*x]]*(c - c*Sin[e + f*x])^(3/2)) + ((A - B)*ArcTanh[Sin[e + f*
x]]*Cos[e + f*x])/(2*c*f*Sqrt[a + a*Sin[e + f*x]]*Sqrt[c - c*Sin[e + f*x]])

Rule 2820

Int[1/(Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*Sqrt[(c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]]), x_Symbol] :> Di
st[Cos[e + f*x]/(Sqrt[a + b*Sin[e + f*x]]*Sqrt[c + d*Sin[e + f*x]]), Int[1/Cos[e + f*x], x], x] /; FreeQ[{a, b
, c, d, e, f}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0]

Rule 3051

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*sin[(e_.
) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x]
)^n/(a*f*(2*m + 1))), x] + Dist[(a*B*(m - n) + A*b*(m + n + 1))/(a*b*(2*m + 1)), Int[(a + b*Sin[e + f*x])^(m +
 1)*(c + d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2
 - b^2, 0] && (LtQ[m, -2^(-1)] || (ILtQ[m + n, 0] &&  !SumSimplerQ[n, 1])) && NeQ[2*m + 1, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {(A+B) \cos (e+f x)}{2 f \sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}}+\frac {(A-B) \int \frac {1}{\sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \, dx}{2 c} \\ & = \frac {(A+B) \cos (e+f x)}{2 f \sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}}+\frac {((A-B) \cos (e+f x)) \int \sec (e+f x) \, dx}{2 c \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \\ & = \frac {(A+B) \cos (e+f x)}{2 f \sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}}+\frac {(A-B) \text {arctanh}(\sin (e+f x)) \cos (e+f x)}{2 c f \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.33 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.85 \[ \int \frac {A+B \sin (e+f x)}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx=\frac {\left (A+B+(-A+B) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )^2+(A-B) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )^2\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 f \sqrt {a (1+\sin (e+f x))} (c-c \sin (e+f x))^{3/2}} \]

[In]

Integrate[(A + B*Sin[e + f*x])/(Sqrt[a + a*Sin[e + f*x]]*(c - c*Sin[e + f*x])^(3/2)),x]

[Out]

((A + B + (-A + B)*Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]]*(Cos[(e + f*x)/2] - Sin[(e + f*x)/2])^2 + (A - B)*
Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]]*(Cos[(e + f*x)/2] - Sin[(e + f*x)/2])^2)*(Cos[(e + f*x)/2] - Sin[(e +
 f*x)/2])*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2]))/(2*f*Sqrt[a*(1 + Sin[e + f*x])]*(c - c*Sin[e + f*x])^(3/2))

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(464\) vs. \(2(91)=182\).

Time = 3.12 (sec) , antiderivative size = 465, normalized size of antiderivative = 4.51

method result size
default \(\frac {A \sin \left (f x +e \right ) \cos \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-A \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right ) \sin \left (f x +e \right ) \cos \left (f x +e \right )-A \left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )+A \left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )-B \sin \left (f x +e \right ) \cos \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )+B \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right ) \sin \left (f x +e \right ) \cos \left (f x +e \right )+B \left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-B \left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )-A \sin \left (f x +e \right ) \cos \left (f x +e \right )+A \left (\cos ^{2}\left (f x +e \right )\right )-A \cos \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )+A \cos \left (f x +e \right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )-B \cos \left (f x +e \right ) \sin \left (f x +e \right )+B \left (\cos ^{2}\left (f x +e \right )\right )+B \cos \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-B \cos \left (f x +e \right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )-A \sin \left (f x +e \right )-B \sin \left (f x +e \right )-A -B}{2 c f \left (-\cos \left (f x +e \right )+\sin \left (f x +e \right )-1\right ) \sqrt {-c \left (\sin \left (f x +e \right )-1\right )}\, \sqrt {a \left (1+\sin \left (f x +e \right )\right )}}\) \(465\)
parts \(\frac {A \left (\left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-\cos \left (f x +e \right ) \sin \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-\left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )+\cos \left (f x +e \right ) \sin \left (f x +e \right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )+\cos \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right ) \cos \left (f x +e \right )-\left (\cos ^{2}\left (f x +e \right )\right )+\cos \left (f x +e \right ) \sin \left (f x +e \right )+\sin \left (f x +e \right )+1\right )}{2 f \left (\cos \left (f x +e \right )-\sin \left (f x +e \right )+1\right ) c \sqrt {-c \left (\sin \left (f x +e \right )-1\right )}\, \sqrt {a \left (1+\sin \left (f x +e \right )\right )}}-\frac {B \left (\left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-\cos \left (f x +e \right ) \sin \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-\left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )+\cos \left (f x +e \right ) \sin \left (f x +e \right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )+\cos \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right ) \cos \left (f x +e \right )+\cos ^{2}\left (f x +e \right )-\cos \left (f x +e \right ) \sin \left (f x +e \right )-\sin \left (f x +e \right )-1\right )}{2 f \left (\cos \left (f x +e \right )-\sin \left (f x +e \right )+1\right ) c \sqrt {-c \left (\sin \left (f x +e \right )-1\right )}\, \sqrt {a \left (1+\sin \left (f x +e \right )\right )}}\) \(495\)

[In]

int((A+B*sin(f*x+e))/(c-c*sin(f*x+e))^(3/2)/(a+a*sin(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2/c/f*(A*sin(f*x+e)*cos(f*x+e)*ln(-cot(f*x+e)+csc(f*x+e)+1)-A*ln(csc(f*x+e)-cot(f*x+e)-1)*sin(f*x+e)*cos(f*x
+e)-A*cos(f*x+e)^2*ln(-cot(f*x+e)+csc(f*x+e)+1)+A*cos(f*x+e)^2*ln(csc(f*x+e)-cot(f*x+e)-1)-B*sin(f*x+e)*cos(f*
x+e)*ln(-cot(f*x+e)+csc(f*x+e)+1)+B*ln(csc(f*x+e)-cot(f*x+e)-1)*sin(f*x+e)*cos(f*x+e)+B*cos(f*x+e)^2*ln(-cot(f
*x+e)+csc(f*x+e)+1)-B*cos(f*x+e)^2*ln(csc(f*x+e)-cot(f*x+e)-1)-A*sin(f*x+e)*cos(f*x+e)+A*cos(f*x+e)^2-A*cos(f*
x+e)*ln(-cot(f*x+e)+csc(f*x+e)+1)+A*cos(f*x+e)*ln(csc(f*x+e)-cot(f*x+e)-1)-B*cos(f*x+e)*sin(f*x+e)+B*cos(f*x+e
)^2+B*cos(f*x+e)*ln(-cot(f*x+e)+csc(f*x+e)+1)-B*cos(f*x+e)*ln(csc(f*x+e)-cot(f*x+e)-1)-A*sin(f*x+e)-B*sin(f*x+
e)-A-B)/(-cos(f*x+e)+sin(f*x+e)-1)/(-c*(sin(f*x+e)-1))^(1/2)/(a*(1+sin(f*x+e)))^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 337, normalized size of antiderivative = 3.27 \[ \int \frac {A+B \sin (e+f x)}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx=\left [-\frac {{\left ({\left (A - B\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - {\left (A - B\right )} \cos \left (f x + e\right )\right )} \sqrt {a c} \log \left (-\frac {a c \cos \left (f x + e\right )^{3} - 2 \, a c \cos \left (f x + e\right ) + 2 \, \sqrt {a c} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c} \sin \left (f x + e\right )}{\cos \left (f x + e\right )^{3}}\right ) + 2 \, \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c} {\left (A + B\right )}}{4 \, {\left (a c^{2} f \cos \left (f x + e\right ) \sin \left (f x + e\right ) - a c^{2} f \cos \left (f x + e\right )\right )}}, -\frac {{\left ({\left (A - B\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - {\left (A - B\right )} \cos \left (f x + e\right )\right )} \sqrt {-a c} \arctan \left (\frac {\sqrt {-a c} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c}}{a c \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right ) + \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c} {\left (A + B\right )}}{2 \, {\left (a c^{2} f \cos \left (f x + e\right ) \sin \left (f x + e\right ) - a c^{2} f \cos \left (f x + e\right )\right )}}\right ] \]

[In]

integrate((A+B*sin(f*x+e))/(c-c*sin(f*x+e))^(3/2)/(a+a*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[-1/4*(((A - B)*cos(f*x + e)*sin(f*x + e) - (A - B)*cos(f*x + e))*sqrt(a*c)*log(-(a*c*cos(f*x + e)^3 - 2*a*c*c
os(f*x + e) + 2*sqrt(a*c)*sqrt(a*sin(f*x + e) + a)*sqrt(-c*sin(f*x + e) + c)*sin(f*x + e))/cos(f*x + e)^3) + 2
*sqrt(a*sin(f*x + e) + a)*sqrt(-c*sin(f*x + e) + c)*(A + B))/(a*c^2*f*cos(f*x + e)*sin(f*x + e) - a*c^2*f*cos(
f*x + e)), -1/2*(((A - B)*cos(f*x + e)*sin(f*x + e) - (A - B)*cos(f*x + e))*sqrt(-a*c)*arctan(sqrt(-a*c)*sqrt(
a*sin(f*x + e) + a)*sqrt(-c*sin(f*x + e) + c)/(a*c*cos(f*x + e)*sin(f*x + e))) + sqrt(a*sin(f*x + e) + a)*sqrt
(-c*sin(f*x + e) + c)*(A + B))/(a*c^2*f*cos(f*x + e)*sin(f*x + e) - a*c^2*f*cos(f*x + e))]

Sympy [F]

\[ \int \frac {A+B \sin (e+f x)}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx=\int \frac {A + B \sin {\left (e + f x \right )}}{\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )} \left (- c \left (\sin {\left (e + f x \right )} - 1\right )\right )^{\frac {3}{2}}}\, dx \]

[In]

integrate((A+B*sin(f*x+e))/(c-c*sin(f*x+e))**(3/2)/(a+a*sin(f*x+e))**(1/2),x)

[Out]

Integral((A + B*sin(e + f*x))/(sqrt(a*(sin(e + f*x) + 1))*(-c*(sin(e + f*x) - 1))**(3/2)), x)

Maxima [F]

\[ \int \frac {A+B \sin (e+f x)}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx=\int { \frac {B \sin \left (f x + e\right ) + A}{\sqrt {a \sin \left (f x + e\right ) + a} {\left (-c \sin \left (f x + e\right ) + c\right )}^{\frac {3}{2}}} \,d x } \]

[In]

integrate((A+B*sin(f*x+e))/(c-c*sin(f*x+e))^(3/2)/(a+a*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate((B*sin(f*x + e) + A)/(sqrt(a*sin(f*x + e) + a)*(-c*sin(f*x + e) + c)^(3/2)), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 204 vs. \(2 (91) = 182\).

Time = 0.36 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.98 \[ \int \frac {A+B \sin (e+f x)}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx=\frac {\frac {{\left (A \sqrt {a} - B \sqrt {a}\right )} \log \left (-\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )}{a c^{\frac {3}{2}} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} - \frac {2 \, {\left (A \sqrt {a} - B \sqrt {a}\right )} \log \left ({\left | \cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right )}{a c^{\frac {3}{2}} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} + \frac {A \sqrt {a} + B \sqrt {a}}{{\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} a c^{\frac {3}{2}} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{4 \, f} \]

[In]

integrate((A+B*sin(f*x+e))/(c-c*sin(f*x+e))^(3/2)/(a+a*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

1/4*((A*sqrt(a) - B*sqrt(a))*log(-cos(-1/4*pi + 1/2*f*x + 1/2*e)^2 + 1)/(a*c^(3/2)*sgn(cos(-1/4*pi + 1/2*f*x +
 1/2*e))*sgn(sin(-1/4*pi + 1/2*f*x + 1/2*e))) - 2*(A*sqrt(a) - B*sqrt(a))*log(abs(cos(-1/4*pi + 1/2*f*x + 1/2*
e)))/(a*c^(3/2)*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sgn(sin(-1/4*pi + 1/2*f*x + 1/2*e))) + (A*sqrt(a) + B*sqrt
(a))/((cos(-1/4*pi + 1/2*f*x + 1/2*e)^2 - 1)*a*c^(3/2)*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sgn(sin(-1/4*pi + 1
/2*f*x + 1/2*e))))/f

Mupad [F(-1)]

Timed out. \[ \int \frac {A+B \sin (e+f x)}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx=\int \frac {A+B\,\sin \left (e+f\,x\right )}{\sqrt {a+a\,\sin \left (e+f\,x\right )}\,{\left (c-c\,\sin \left (e+f\,x\right )\right )}^{3/2}} \,d x \]

[In]

int((A + B*sin(e + f*x))/((a + a*sin(e + f*x))^(1/2)*(c - c*sin(e + f*x))^(3/2)),x)

[Out]

int((A + B*sin(e + f*x))/((a + a*sin(e + f*x))^(1/2)*(c - c*sin(e + f*x))^(3/2)), x)